package com.wms.login.service;

import java.util.List;

import org.apache.log4j.Logger;

import com.wms.common.db.AbstractBaseService;
import com.wms.db.bean.User;
import com.wms.db.dao.IUserDao;
import com.wms.mail.WeekMeetingMail;

public class LoginService extends AbstractBaseService{
	Logger logger = Logger.getLogger(this.getClass());
	
	private IUserDao userDao;
	
	public boolean authenticate(String username, String password) throws Exception{
		User user = userDao.loadAll().get(0);
		List<User> us = this.baseDao.find("from User");
		User u = us.get(0);
		logger.error("userDao: "+user.getUsername());
		logger.error("baseDao: "+u.getUsername());
		WeekMeetingMail mail = new WeekMeetingMail("asia\\yongdu","Letmein123");
//		mail.sendWMrequest();
		return true;
	}

	public void setUserDao(IUserDao userDao) {
		this.userDao = userDao;
	}

	public IUserDao getUserDao() {
		return userDao;
	}

}
